package com.wyc.apidriver.controller;

import com.wyc.apidriver.service.DriverUserService;
import com.wyc.internalCommon.request.DriverUserDTO;
import com.wyc.internalCommon.request.DriverUserWorkStatusDTO;
import com.wyc.internalCommon.result.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 司机信息管理
 */
@RestController
public class DriverUserController {


    @Autowired
    private DriverUserService driverUserService;

    /**
     * 新增或修改司机信息
     * @param driverUserDTO
     * @return
     */
    @PostMapping("/driver-user")
    public ApiResult addDriverUser(@RequestBody DriverUserDTO driverUserDTO){
        return driverUserService.addDriverUser(driverUserDTO);
    }

    /**
     * 修改司机工作状态
     * @param workStatusDTO
     * @return
     */
    @PostMapping("/driver-user-work-status")
    public ApiResult updateWorkStatus(@RequestBody DriverUserWorkStatusDTO workStatusDTO){
        return driverUserService.updateWorkStatus(workStatusDTO);
    }

}
